 <extend name="common:commonTemplate" />

<block name="main_content">
<style>
	.order_user1 {
	    background-color: #fff;
	    background-image: url("/Public/images/line_bg2.png");
	    background-position: 0 bottom;
	    background-repeat: repeat-x;
	    color: #666;
	    display: block;
	    padding: 0.5rem 8% 1rem 5%;
	    position: relative;
	}
	
	.order_user1::after {
	    background-repeat: no-repeat;
	    background-size: 100% auto;
	    content: "";
	    height: 2rem;
	    margin-top: -1rem;
	    position: absolute;
	    right: 0.2rem;
	    top: 50%;
	    width: 1rem;
	}
</style>

<div class="orderlist">
        <dl>
            <dt>订单编号：{$promoter_order_en.order_id}<span style="color:red;">【{$promoter_order_en.order_status_text}】</span></dt>
            <dd>
                <div class="order_commission">
                    <p class="commission_txt1">提成金额<span style="color:red;">【{$promoter_order_en.order_revenue_status_text}】</span></p>
                    <p class="commission_txt2">￥{$promoter_order_en.revenue_amount}</p>
                </div>
                <ul class="commission_list">
                    <li><span>下单时间：</span>{$order_en.order_date}</li>
                    <li><span>商品金额：</span>￥{$order_en.goods_amount}</li>
                    <li><span>折扣金额：</span>￥{$order_en.discount_fee}</li>
                    <li><span>订单金额：</span>￥{$order_en.order_amount}</li>
                    <li><span>运 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;费：</span>￥{$order_en.freight}</li>
                    <li><span>推&nbsp; 荐&nbsp;人：</span>{$promoter_order_en.promoter_name}</li>
                    <li><span>收&nbsp; 货&nbsp;人：</span>{$order_en.consignee_name}({$order_en.consignee_cellphone})</li>
                    <li><span>收货地址：</span>{$order_en.consignee_province} {$order_en.consignee_city} {$order_en.consignee_district} {$order_en.consignee_address}</li>
                    
                    <if condition="$order_en.logistics_company neq ''">
                    <li><span>快递公司：</span>{$order_en.logistics_company}</li>
                    <li><span>物流单号：</span>
                    	<a href="/order/logisticsDetail?logistics_no={$order_en.logistics_no}" style="color:blue;">{$order_en.logistics_no}</a>
                    </li>
                    </if>
                    
                </ul>
            </dd>
        </dl>
        

        <div class="prodbox">
            <div class="hd"> <span class="t1">商品列表</span> <span class="t2">共{$order_en.goods_qty}件商品</span></div>
            <ul class="prodlist">
                <volist name="lst_order_detail_en" id="order_detail_en">
                	<li>
	                    <div class="prodimg">
	                        <img src="{$order_detail_en.image}" alt=""/>
	                    </div>
	                    <div class="proddetail">
	                        <p class="prodname">{$order_detail_en.style_name}</p>
	                        <p class="price">{$order_detail_en.sale_price}</p>
	                        <p class="prod_num">x<span class="qty">{$order_detail_en.qty}</span></p>
	                    </div>

                	</li>
                </volist>
            </ul>
        </div>
    </div>
    
<if condition="$can_cancel eq 1 OR $can_payment eq 1">
<div class="cartfix2">
	<if condition="$can_cancel eq 1">
		<a id="btn_cancel" order_id="{$order_en.order_id}" href="#" class="btn_cancel">取消订单</a>
	</if>
    <if condition="$can_payment eq 1">
		<b><a href="/buy/orderSuccess?order_id={$order_en.order_id}" class="btn_ok">尚未支付，去支付</a></b>
	</if>
</div>
</if>

</block>

<block name="inner_script">
<script>
$(function(){
	//  获取列表高度，多出滚动
	  var maxH;
	  var winH=window.innerHeight;
	  var h1=(document.body.offsetWidth/320) *14*5
	  maxH=winH-2*h1;
	
	  $('.orderlist').css({
	      'height':maxH
	  })
	});
	
$(document).ready(function(){
	$('#btn_cancel').bind('click', function(){
		var order_id = $(this).attr('order_id');
		
		if(confirm("确认要取消订单么？")){
			var result = OrderService.CancelOrder(order_id);
			
			if(result.IsSuccess == 0){
				alert(result.ErrorMsg);
				return;
			}
			else{
				alert('订单取消成功！');
				location.reload();
			}
		}
	});
});
</script>
</block>
 